home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_mp1-outside.cog < prev    next >
Text File  |  1999-11-15  |  7KB  |  284 lines

  1. # Jones 3D Cog Script
  2. #
  3. # VOL_MP1-2Wall Blaster.cog
  4. #
  5. # an all-purpose cog for the IMP#1 effect on 2 walls
  6. #
  7. # [CMG]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14. #    MESSAGES
  15. message     startup
  16. message     activated
  17. message        damaged
  18. message        entered
  19. message        pulse
  20.  
  21. #    ACTORS
  22. thing    player                                        local
  23.  
  24. #    CAMERAS
  25. thing       offsetCam
  26.     
  27.  
  28. #    THINGS
  29. thing       bombpos            
  30. thing        fragment                                local
  31. thing        dustthing                                local
  32.  
  33. #    SURFACES
  34. surface        crackedwall                                mask=0x408    linkID=2
  35. surface        crackedwall1                            mask=0x08   linkID=2
  36. surface        crackedwall2                            mask=0x08   linkID=2
  37. surface        mantle                                    mask=0x08   linkID=2
  38.     
  39. surface        speaksurf    
  40.  
  41. #    MATERIALS
  42. material    dustmat=gen_a4sfx_dustcloud.mat            local
  43.  
  44.  
  45. #    SOUND FX
  46. sound        explosion=imp1_wall_break.wav            local
  47. sound       sfxCharge=imp1_chargeup.wav             local
  48. sound       mus_Eerie=mus_gen_eerie1.wav            local
  49.  
  50.  
  51. # ** voice lines **
  52. sound       inCrumble=Inxj025.wav                   local   # ...ready to crumble.
  53. sound       inVibrate=Inxj026.wav                   local   # A little vibration...
  54.  
  55.  
  56. #    TEMPLATES
  57. template    debris=stoneshrapa_nc                    local
  58. template    bomb=ghost                                local
  59. template    dust=dustcloud4ever                        local
  60.  
  61. #    VARIABLES AND VECTORS
  62.  
  63. int         saidIt=0                                local
  64. int            i=0                                           local
  65. int         done=0                                  local
  66. int         playing=0                               local
  67. flex        vibeline                                local
  68.  
  69.  
  70. vector        duststart                                  local
  71. vector        dustend                                    local
  72. vector      playervec                                 local
  73. vector      playery                                    local
  74. vector      playerx                                    local
  75.  
  76. end
  77.  
  78. # ========================================================================================
  79. code
  80. startup:
  81.     
  82.     
  83.     player = GetLocalPlayerThing();
  84.     Sleep(.3);
  85.     ClearAdjoinFlags(crackedwall, 2);
  86.     ClearAdjoinFlags(crackedwall1, 2);
  87.     ClearAdjoinFlags(crackedwall2, 2);
  88.     ClearAdjoinFlags(GetSurfaceAdjoin(crackedwall), 2);
  89.     ClearAdjoinFlags(GetSurfaceAdjoin(crackedwall1), 2);
  90.     ClearAdjoinFlags(GetSurfaceAdjoin(crackedwall2), 2);
  91.     SetFaceGeoMode(crackedwall, 4);
  92.     SetFaceGeoMode(crackedwall1, 4);
  93.     SetFaceGeoMode(crackedwall2, 4);
  94.     duststart    = VectorSet(0.2, 0.2, 0.5);
  95.     dustend    = VectorSet(0.4, 0.4, 0.0);
  96.  
  97. return;
  98.  
  99. # ========================================================================================
  100. activated:
  101.     
  102.  
  103.     if((GetSenderRef() == crackedwall) && (done == 0) && (playing == 0))
  104.     {
  105.         # player activated with an IMP part so bail out
  106.         if((GetCurWeapon(player) >= 14) && (GetCurWeapon(player) <= 18)) return;
  107.         
  108.         # player activated with lighter
  109.         else if(GetCurWeapon(player) == 13)
  110.         {
  111.             playing = 1;
  112.             
  113.             # put away the lighter
  114.             DeselectWeapon(player);
  115.             DeselectWeaponWait(player);
  116.             
  117.             Call vibeLine;
  118.         }
  119.         
  120.         # normal activation
  121.         else
  122.         {
  123.             playing = 1;
  124.             
  125.             # wait for weapon to be put away
  126.             DeselectWeaponWait(player);
  127.             
  128.             Call vibeLine;
  129.         }
  130.     }   
  131.  
  132.     return;
  133.     
  134. # ========================================================================================
  135. damaged:
  136.     
  137.     if (GetSenderID() != 2) return;
  138.  
  139.     if((GetParam(1) == 0x1000) && (done == 0))
  140.     {
  141.         done = 1;
  142.         
  143.         # do cutscene stuff
  144.         MakeMeStop();
  145.         
  146.         # interp camera
  147.         SetExtCamOffsetToThing(offsetCam);
  148.         
  149.         # start cameraShake
  150.         SetPulse(0.05);
  151.        
  152.         # alter fov for zoom-in effect
  153.         SetCameraFOV(70, 1, 2.5);
  154.         
  155.         # play temp sfx
  156.         PlaySoundLocal(sfxCharge, 1.0, 0.0, 0x0, 0);
  157.         
  158.         # light up the player
  159.         SetThingLight(bombpos, '0.25 0.55 1.0', 5.0, 2.0);
  160.         Sleep(1.0);
  161.  
  162.         # play explosion sfx
  163.         PlaySoundLocal(explosion, 1, 0, 0x0, 0);
  164.         
  165.         Sleep(1.0);
  166.         
  167.         # reset fov
  168.         ResetCameraFOV(0, 0.0);
  169.         
  170.         # kill dynamic light
  171.         SetThingLight(bombpos, '0.0 0.0 0.0', 5.0, 2.0);
  172.         
  173.         
  174.         # create the debris
  175.         for(i=0; i<8; i=i+1)                                                                        
  176.         {
  177.         fragment = CreateThing(debris, bombpos);                                 
  178.         SetThingVel(fragment, VectorScale(VectorAdd(RandVec(), '-0.5 -0.1 0.0'), 1));
  179.         SetThingRotVel(fragment, VectorScale(VectorAdd(RandVec(), '0.0 0.0 0.0'), 200.0));
  180.         Sleep(0.025);
  181.         }
  182.         
  183.         # alter adjoins
  184.         SetAdjoinFlags(crackedwall, 2);
  185.         SetAdjoinFlags(GetSurfaceAdjoin(crackedwall), 2);
  186.         SetAdjoinFlags(crackedwall1, 2);
  187.         SetAdjoinFlags(GetSurfaceAdjoin(crackedwall1), 2);
  188.         SetAdjoinFlags(crackedwall2, 2);
  189.         SetAdjoinFlags(GetSurfaceAdjoin(crackedwall2), 2);
  190.  
  191.         SetFaceGeoMode(crackedwall, 0);
  192.         SetFaceGeoMode(crackedwall1, 0);
  193.         SetFaceGeoMode(crackedwall2, 0);
  194.         
  195.         # stop the screenshake
  196.         SetPulse(0);
  197.  
  198.         # create and animate the dust sprite
  199.         SetMaterialCel(dustmat, 0);
  200.         MaterialAnim(dustmat, 8.0, 1);
  201.         dustthing = CreateThing(dust, bombpos);
  202.         AnimateSpriteSize(dustthing, duststart, dustend, 7.0);
  203.         
  204.         # rest for a bit
  205.         Sleep(0.5);
  206.         
  207.         # restore camera
  208.         SetCameraPosition(1, GetThingPos(offsetCam));
  209.         SetCurrentCamera(1);
  210.         
  211.         # restore controls
  212.         RestoreExtCam();
  213.         ResetCameraFOV(0, 0.0);
  214.         EndCutscene();
  215.         ClearActorFlags(player, 0x200000);
  216.         
  217.         # play music cue (temp?)
  218.         PlaySoundLocal(mus_Eerie, 1.0, 0.0, 0x0, 0);
  219.     }
  220.  
  221. return;
  222.     
  223. # ========================================================================================
  224. entered:
  225.  
  226.     player = GetLocalPlayerThing();
  227.     playervec = GetThingLVec(player);
  228.     playery = VectorY(playervec);
  229.     playerx = VectorX(playervec);
  230.  
  231.     if((GetSenderRef() == speaksurf) && (saidIt == 0))
  232.     {
  233.         if ((playerx > 0) && ((playery > -0.7) && (playery < 0.7)))     # east
  234.         {
  235.             saidIt = 1;
  236.             PlayVoice(player, inCrumble, 1.0, 1);
  237.         }
  238.     }
  239.     
  240.     return;
  241.  
  242.  
  243. # ========================================================================================
  244. vibeLine:
  245.  
  246.     # do cutscene stuff
  247.     MakeMeStop();
  248.     StartCutscene(0);
  249.     
  250.     # interp camera
  251.     SetExtCamOffsetToThing(offsetCam);
  252.     
  253.     # activate face and say line
  254.     PlayMode(player, 60, 0);
  255.     Sleep(0.3);
  256.     PlayVoice(player, inVibrate, 1.0, 1);
  257.     
  258.     # restore controls and camera
  259.     RestoreExtCam();
  260.     
  261.     EndCutscene();
  262.     ResetCameraFOV(0, 0.0);
  263.     ClearActorFlags(player, 0x200000);
  264.     
  265.     playing = 0;
  266.     
  267.     return;
  268.  
  269. # ========================================================================================
  270. pulse:
  271.  
  272.     
  273.         SetPOVShake('0.0 0.0 0.001', '0.0 0.0 0.0', 80.0, 0.80);
  274.     return;
  275.  
  276. # ========================================================================================
  277.  
  278.  
  279. end
  280.  
  281.  
  282.  
  283.  
  284.